package com.dahua.messagesyncsh.business;

import com.dahua.messagesyncsh.util.StringUtil;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public enum DataType {
    SPEED(1,"PT_SPEED"),
    VIB(2,"PT_VIB"),
    STATIC(3,"PT_STATIC");
    private int type;
    private String data;
    public static int getType(String key){
        for (DataType temp : DataType.values()){
            if (StringUtil.isExit(key, temp.data) != -1){
                return temp.type;
            }
        }
        return -1;
    }
}
